package sng.modules.view.components.city.state
{
	import sng.modules.model.vo.UserBuildingVO;
	import sng.modules.view.components.city.cursor.CityCursor;
	import sng.modules.view.components.city.cursor.CityCursorManager;
	import sng.modules.view.components.city.logic.City;
	import sng.modules.view.components.city.strategy.CityStrategyManage;
	
	/**
	 * 
	 * @author leonliu
	 * 新建状态
	 * 
	 */	
	public class CityNewState implements ICityState
	{
		public function CityNewState(_city:City)
		{
			city=_city;
			
			//更改指针状态 eason 20110714
			CityCursorManager.getInstance().setCursor(CityCursor.ADD_CURSOR);
		}
		public var city:City;
		public function Execute(parameter:*=null):void
		{
			city.createBuilding(parameter as UserBuildingVO);
			CityStrategyManage.setAddBonusRate(city.currentBuilding);//增加新地址带来的增益效果影响 
			CityStrategyManage.setIdelBuilds(city.currentBuilding,false);
			city.setCityState(new CityNormalState(city));//从新建状态改到正常状态
		}
		
		public function toString():String
		{
			return "CityNewState";
		}
	}
}